<extend name="Base/common"/>


<block name="body">
<style>
    #main-container{
        width: 880px;
    }
</style>
    <link href="__PUBLIC__/Weibo/css/weibo.css" rel="stylesheet"/>
    <!--微博左侧内容列表部分-->
    <!--微博左侧内容列表部分-->
    <!--微博内容列表部分-->
    <div class="weibo_middle col-md-8">
        <include file="_quickweibo"/>
        <div>

            {:hook('Advs', 'weibo_below_sendbox')}
        </div>
        <!--  筛选部分-->
        <if condition="is_login()">
            <div>
                <div id="weibo_filter" style="margin-bottom: 10px">
                        <a id="all"  href="{:U('Weibo/Index/index')}">全站动态</a>
                        <a id="concerned" href="{:U('Weibo/Index/myconcerned')}">我的关注</a>
                </div>
            </div>
            <script>
                $('#weibo_filter #{$filter_tab}').addClass('active');
                /*                    $('#nav_bar_container').append( $('#weibo_filter'));*/
            </script>
        </if>
        <!--筛选部分结束-->
        <div id="weibo_list">
            <include file="loadweibo"/>
        </div>

        <div id="load_more" class="text-center text-muted"
        <if condition="$page neq 1">style="display:none"</if>
        >
        <p id="load_more_text">载入更多</p>
    </div>

    <div id="index_weibo_page" style=" <if condition='$page eq 1'>display:none</if>">
        <div class="text-right">
            {:getPagination($total_count,30)}
        </div>
    </div>
    </div>

    <!--微博内容列表部分结束-->

    <!--首页右侧部分-->
    <div class="weibo_right col-md-4">

        <!--登录后显示个人区域-->
        <if condition="is_login()">
            <div ><img class="cover" src="__PUBLIC__/Weibo/images/bg.jpg" style="height: 70px;width: 100%"></div>

            <div class=" user_info" style="padding: 0px;background-color: #ffffff;">

                <div class="avatar-bg">


                    <div class="headpic ">
                        <a href="{$self.space_url}" ucard="{$self.uid}"><img src="{$self.avatar128}"
                                                                             class="avatar-img"
                                                                             style="width:60px;"/></a>
                    </div>


                    <div class="clearfix " style="padding: 0px;margin-bottom:8px">
                        <div class="col-xs-12" style="text-align: center">
                        <span class="name_touxian">
                            {$self.title}
                        <a ucard="{$self.user.uid}" href="{$self.space_url}" class="user_name">{$self.nickname|htmlspecialchars}</a>

                             <if condition="$self['rank_link'][0]['num']">
                                 <volist name="self['rank_link']" id="vl">
                                     <if condition="$vl['is_show']">
                                         <img src="{$vl.logo_url}" title="{$vl.title}"
                                              alt="{$vl.title}"
                                              style="width: 18px;height: 18px;vertical-align: middle;margin-left: 2px;"/>
                                     </if>
                                 </volist>
                                 <else/>

                             </if>
                            </span>
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('usercenter/index/applist',array('uid'=>$self['uid'],'type'=>'weibo'))}" title="微博数">{$self.weibocount}</a><br>微博
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('usercenter/index/fans',array('uid'=>$self['uid']))}" title="粉丝数">{$self.fans}</a><br>粉丝
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('usercenter/index/following',array('uid'=>$self['uid']))}" title="关注数">{$self.following}</a><br>关注
                        </div>
                    </div>

                </div>
            </div>
        </if>
        <!--登录后显示个人区域部分结束-->

        <div>
            <div class="checkin">
                {:hook('checkin')}


                {:hook('Rank')}
            </div>
            {:hook('weiboSide')}
            <!--广告位-->
            {:hook('Advs', 'weibo_below_checkrank')}
            <!--广告位end-->
            {:W('TopUserList/lists',array(null,'score desc','活跃用户','top'))}
            {:W('UserList/lists')}

        </div>
    </div>
    <!--首页右侧部分结束-->


</block>

<block name="script">

    <script src="__JS__/weibo.js"></script>
    <script>
        var SUPPORT_URL = "{:addons_url('Support://Support/doSupport')}";
        var noMoreNextPage = false;
        var isLoadingWeibo = false;
        var currentPage = '{$page}';
        var loadCount = 1;
        var lastId = '{$lastId}';
        var url = "{$loadMoreUrl}";
        $(function () {
            //当屏幕滚动到底部时

            if (currentPage == 1) {
                $(window).on('scroll', function () {
                    if (noMoreNextPage) {
                        return;
                    }
                    if (isLoadingWeibo) {
                        return;
                    }
                    if (isLoadMoreVisible()) {
                        loadNextPage();
                    }
                });
                $(window).trigger('scroll');
            }


        });
    </script>


</block>
